title = "分类详情页"
url = '/special/index_boy.html'
title = '分类详情页模板'
layout = 'default'
==

use Jason\Ccshop\Controllers\Filters;
use Jason\Ccshop\Controllers\Categories;
use Jason\Ccshop\Models\Category;
use Jason\Ccshop\Models\Product;
function onStart(){
	
	$c = App::make('Jason\Ccshop\Components\Catalog')->ProductSection('m_group_boy');
	//dump($c);
}
==

{% put page_title %}boy{% endput %}

{# id广告(先别动,等需求,让龙哥说) #}
{% if count(adproducts) > 0 %}
<div class="indexTjThree" style="">
	<div class="swiper-container indexTjThree_swipe swiper-container-horizontal">
	    <div class="swiper-wrapper">

	        {% for adproduct in adproducts %}
				<div class="swiper-slide ">
					<a href="{{ adproduct.url }}" style="display: block;margin: 0 5px;">
						<div class="posiR">
							{% for img in adproduct.feature_image %}
							{% if loop.index == 1%}
							<img src="{{ img.path }}" alt="{{adproduct.name}}">
							{% endif %}
							{% endfor  %}
						</div>
				    	<div class="contBlock">
							<p class="txtGray1 Ellipsis">{{ adproduct.name }}</p>
							<p class="txtGray"><b>{{ adproduct.price|formatPrice }}</b></p>
						</div>
					</a>
				</div>
			{% endfor %}

			{% for key, val in catalog.productSection('m-promote-product', products.data[0].id).items %}
			{% if val.id not in pida %}
			<div class="swiper-slide" style="margin-left:0;">
				<a href="{{ val.url }}" style="display: block;margin: 0 5px;">
					<div class="posiR">
						{% for img in val.feature_image %}
						{% if loop.index == 1%}
						<img src="{{ val.f_thumb }}" alt="{{val.name}}">
						{% endif %}
						{% endfor  %}
					</div>
					<div class="contBlock">
						<p class="txtGray1 Ellipsis">{{ val.name }}</p>
						<p class="txtGray"><b>{{ val.price|formatPrice }}</b></p>
					</div>
				</a>
			</div>

			{% endif %}
			{% endfor %}
    	</div>
    	<!--  -->
	    <div class="swiper-button-prev"></div>
	    <div class="swiper-button-next"></div>
	</div>
</div>
{% endif %}

{# 页面内容主体 #}
<div class="category_content">
	<!--<div style="overflow: hidden;margin: 5px 0 10px;">-->
		<!--<p class="allItemNum"> 全{{ products.total }} 商品 </p>-->
		<!--{{ products.render|raw }}-->
	<!--</div>-->
	<!--{% partial 'catalog/list-toolbar' products = products.data %}-->
	{# 面包屑路径 #}
	{#% partial 'common/breadCrumb' %#}
	
	<div class="">
		{# 商品列表开始 #}
		<div class="itemList">
			<ul class="listUl">
				{# 循环商品 #}
				{% for key, val in catalog.ProductSection('m_group_boy').items %}
				<li class="product_h">
					<a href="{{ val.url }}">
						<div class="productImg">
							<img src="{{ val.f_thumb }}" alt="{{ val.name }}" class="productImgH">
							{% if val.saled > 500 %}
							<span class="hotSale sale_"><img src="{{ 'assets/img/hotSale.png'|theme }}" alt=""></span>
							{% endif %}
	
							{% if val.labels == "newest" %}
							<span class="newSale sale_"><img src="{{ 'assets/img/newSale.png'|theme }}" alt=""></span>
							{% endif %}
						</div>
						<div class="contBlock">
							<p class="txtGray1 Ellipsis">{{val.name}}</p>
							<p class="txtGray"><b>{{ val.price|formatPrice }}</b>税込 &nbsp;
								{% if val.discount %}
								<span class="proSale"><b>{{ val.discount }}</b>OFF</span>
								{% endif %}
							</p>
							<p class="txtGray" style="height: 18px;">
								{% if val.reviews_total > 0 %}
								<a href="{{ val.url }}#categoryReviews" style="height:18px;line-height:18px;text-align:right;">レビュー({{ val.reviews_total }})</a>
								{% endif %}
							</p>
	
						</div>
					</a>
				</li>
				{% endfor %}
			</ul>
			{# 分页按钮 #}
			<div style="overflow: hidden;margin: 5px 0 10px;">
				<!-- <p class="allItemNum"> 全{{ products.total }} 商品 </p> -->
				{{# products.render|raw #}}
			</div>
		</div>
	</div>
</div>


{# GA统计代码(第三方接口,先别动) #}
{% for key, product in products.data %}
  {% put google_tag_params %}
  var google_tag_params = {
    ecomm_prodid: "{{product.id}}",
    ecomm_pagetype: "category",
    ecomm_totalvalue: {{product.price|ratePrice}}
  };
  {% endput %}
{% endfor %}